package com.ying.common.entity;

public enum ResponseCode {

    SUCCESS(200, "操作成功"),
    FAILED(500, "操作异常"),
    LOGOUT(200, "退出成功"),
    BAD_REQUEST(400, "参数异常"),
    VALIDATE_FAILED(404, "请求不存在"),
    HTTP_BAD_METHOD(405, "请求方式不支持"),

    UNAUTHORIZED(401, "请先登录"),
    ACCESS_DENIED(403, "权限不足"),
    USER_DISABLED(403, "当前用户已被锁定，请联系管理员解锁"),
    USERNAME_PASSWORD_ERROR(5001, "用户名或密码错误"),
    TOKEN_EXPIRED(5002, "Token 已过期，请重新登录"),
    TOKEN_PARSE_ERROR(5002, "Token 解析失败，请尝试重新登录"),
    TOKEN_OUT_OF_CTRL(5003, "当前用户已在别处登录，请尝试更改密码或重新登录"),
    KICKOUT_SELF(5004, "无法手动踢出自己，请尝试退出登录操作！");

    private Integer code;
    private String msg;

    ResponseCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
